home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_b
/
reloc.act
< prev
next >
Wrap
Text File
|
1995-04-22
|
2KB
|
86 lines
MODULE ;RELOCATE.ACT
;Run-time Relocator Code.
;For use with RELGEN.ACT
;COPYRIGHT 1984, JS DeMar
;Rev. 1.1, March 20,1984
;---------------------------------
SET 14=$6000
SET $0491=$6000
;---------------------------------
;The beginning of the relocator
;table and code should be higher
;than the expected end of the final
;relocated program. But, there must
;be enough space left for the table
;and the relocator code itself!
;---------------------------------
;---------------------------------
;Read the ".GEN" file above here.
;---------------------------------
;Compile this after reading in the
;".GEN" file above. Then append the
;".REL" file to this code using the
;DOS COPY command with "/A".
;---------------------------------
PROC Error(BYTE err)[$6C$A]
PROC Break=*()
[$BA$8E$4C1$80A0$98$4C Error]
PROC ChkErr=*(BYTE r,b,eC)[$1610$88C0$8F0
$98$80C0$11F0
$4C Error$8A$4A4A$4A4A$98AA$9D EOF$60]
PROC Break1=*(BYTE err)
[$1A2$1186$48$20 Break$68$A8$60]
CHAR FUNC GetD=*(BYTE d)[$7A2]
PROC CCIO=*()
[$A486$A0A$A0A$AA$A4A5$9D$342$A9$0$9D$348$9D$349
$98$20$E456$A085$4C ChkErr]
;---------------------------------
PROC BootIt=*()
;---------------------------------
PROC Relocate()
BYTE offset,memlohi=$02E8,x
CARD memlo=$02E7,i,j,top,entry
BYTE ARRAY newplace
newplace=memlo
newplace==&$FF00
offset=memlohi
i=memlo&$00FF
IF i#0 THEN
newplace==+$0100
offset==+1
FI
FOR i=1 TO 6
DO
x=GetD(1)
OD
j=0
FOR i=start TO finish+7
DO
x=GetD(1)
newplace(j)=x
j==+1
OD
FOR i=0 TO hits-1
DO
entry=otable(i)
newplace(entry)==+offset
OD
runaddr==+newplace
[$6C runaddr]